package javar;

import java.util.List;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;

public class LengthMethod implements TemplateMethodModel {

	public Object exec(List arg0) throws TemplateModelException {
		if(null == arg0 || arg0.size() != 1) {
			throw new RuntimeException("参数有误");
		}
		return arg0.get(0).toString().length();
	}

}
